New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[google|compute] auth needs additional scope to insert images #2533
Conversation
What request are you sending that needed this additional auth? Are there docs somewhere that are wrong? |
@icco The additional scope was needed to be able to use insert image call, at least when using a service account (which is required for fog). Without this, you would get a permission denied or such error (I forget exactly). |
@icco Here's the error:
This is the call: This is what we do to create the image: image_opts = {
'rawDisk' => { 'containerType' => "TAR", 'source' => "http://storage.googleapis.com/#{bucket}/#{image_name}.tar.gz" }
}
response = fog.insert_image(image_name,image_opts)
operation_id = response.body["name"]
image_id = "projects/#{project}/images/#{image_name}"
puts "Waiting for image to be ready. ID: #{image_id}"
puts "OPERATION: #{operation_id}"
$i=0
$retries=30
$wait=30
status = ""
until $i > $retries do
# Fog::Errors::Error exception will be thrown if get_global_operation returns a failure status
details = retry_errors { fog.get_global_operation(operation_id).body }
progress = details["progress"]
status = details["status"]
$i += 1;
puts "[#$i/#$retries] Status: #{status} Progress: #{progress}"
if status == "DONE"
break
else
sleep $wait unless $i > $retries
end
end
unless status == "DONE"
raise "Timed out waiting for reply"
end I tried following the example at: Can this PR be merged? According to the Google README: There isn't a doc wrong, as far as the reason for needing this change. You just need to launch the instance with the proper scope to be able to image the instance. |
[google|compute] auth needs additional scope to insert images into GCS
Thanks! On Thu, Mar 6, 2014 at 4:23 PM, Nat Welch notifications@github.com wrote:
|
No description provided.